package oa.service.impl;

import java.util.List;

import oa.dao.ApplicationDao;
import oa.dao.impl.ApplicationDaoImpl;
import oa.entity.Application;
import oa.exception.DaoException;
import oa.service.ApplicationService;

public class ApplicationServiceImpl implements ApplicationService{

	ApplicationDao applicationDao = new ApplicationDaoImpl();
	@Override
	public List<Application> selectAllApplication() {
		try {
			return applicationDao.selectAllApplication();
		} catch (DaoException e) {
			e.printStackTrace();
		}
		return null;
	}

	@Override
	public List<Application> selectApplication(int id, String type, int status) {
		try {
			return applicationDao.selectApplication(id, type, status);
		} catch (DaoException e) {
			e.printStackTrace();
		}
		return null;
	}

	@Override
	public boolean deleteApplication(int id) {
		try {
			return applicationDao.deleteApplication(id);
		} catch (DaoException e) {
			e.printStackTrace();
		}
		return false;
	}

	@Override
	public boolean upadteApplication(Application application) {
		try {
			return applicationDao.upadteApplication(application);
		} catch (DaoException e) {
			e.printStackTrace();
		}
		return false;
	}

	@Override
	public boolean addApplication(Application application) {
		try {
			return applicationDao.addApplication(application);
		} catch (DaoException e) {
			e.printStackTrace();
		}
		return false;
	}

	@Override
	public List<Application> selectApplications(String status, int companyid, Integer pageNo, Integer row)
			throws DaoException {
		// TODO Auto-generated method stub
		return applicationDao.selectApplications(status, companyid, pageNo, row);
	}

	@Override
	public int appcount(String status, int companyid,int userid) throws DaoException {
		// TODO Auto-generated method stub
		return applicationDao.appcount(status, companyid,userid);
	}

	@Override
	public List<Application> selectApplicationusercompany(int userid,  Integer pageNo, Integer row)
			throws DaoException {
		
		return applicationDao.selectApplicationusercompany(userid, pageNo, row);
	}

}
